home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX 6.2 Development Libraries
/
SGI IRIX 6.2 Development Libraries.iso
/
dist
/
complib.idb
/
usr
/
share
/
catman
/
p_man
/
cat3
/
complib
/
sscal1d.z
/
sscal1d
Wrap
Text File
|
1996-03-14
|
6KB
|
133 lines
ssssssssccccaaaallll1111dddd,,,,ddddssssccccaaaallll1111dddd((((3333FFFF)))) ssssssssccccaaaallll1111dddd,,,,ddddssssccccaaaallll1111dddd((((3333FFFF))))
NNNNAAAAMMMMEEEE
ssssssssccccaaaallll1111dddd,,,, ddddssssccccaaaallll1111dddd ---- scales a 1D real sequence.
SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
_F_o_r_t_r_a_n :
ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ssssssssccccaaaallll1111dddd(((( nnnn,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc))))
iiiinnnntttteeeeggggeeeerrrr nnnn,,,, iiiinnnncccc
rrrreeeeaaaallll aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy((((0000::::((((nnnn----1111))))****iiiinnnncccc))))
ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ddddssssccccaaaallll1111dddd(((( ssssiiiiggggnnnn,,,, nnnn,,,, pppp,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc,,,, llllddddaaaa))))
iiiinnnntttteeeeggggeeeerrrr nnnn,,,, iiiinnnncccc
rrrreeeeaaaallll****8888 aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy((((0000::::((((nnnn----1111))))****iiiinnnncccc))))
_C :
####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
iiiinnnntttt ssssssssccccaaaallll1111dddd (((( iiiinnnntttt nnnn,,,, ffffllllooooaaaatttt aaaallllpppphhhhaaaa,,,, ffffllllooooaaaatttt ****aaaarrrrrrrraaaayyyy,,,, iiiinnnntttt iiiinnnncccc))));;;;
iiiinnnntttt ddddssssccccaaaallll1111dddd (((( iiiinnnntttt nnnn,,,, ddddoooouuuubbbblllleeee aaaallllpppphhhhaaaa,,,, ddddoooouuuubbbblllleeee ****aaaarrrrrrrraaaayyyy,,,, iiiinnnntttt iiiinnnncccc))));;;;
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
ssssssssccccaaaallll1111dddd and ddddssssccccaaaallll1111dddd scale a 1D real sequence of N samples.
The Fourier Transforms are not normalized so the succession Direct-
Inverse transform scales the input data by a factor equal to the size of
the transform. ssssssssccccaaaallll1111dddd or ddddssssccccaaaallll1111dddd may be used to scale back the result.
PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
NNNN Integer, the number of samples in each sequence.
Unchanged on exit.
PPPP Integer, the number of sequences. Unchanged on exit.
AAAAllllpppphhhhaaaa scaling floating point value.
AAAARRRRRRRRAAAAYYYY Array containing the samples of the sequence to be scaled (in
place).
IIIINNNNCCCC Integer, increment between two consecutive elements of a sequence.
Unchanged on exit.
LLLLDDDDAAAA Integer, leading dimension: increment between the first samples of
two consecutive sequences. Unchanged on exit.
EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
Given a 1024 real values sequence. We successively apply a Direct
Fourier Transform, an Inverse Fourier Trasnform and finally scale back
the result by a factor 1/N (1/1024.)-
This sequence DirectFFT-InverseFFT-Scaling is equivalent to the identity
operator and the final sequence should be equal (with round-off
precision) to the initial sequence.
Elements of each sequence are stored with increment (stride) 1.
_F_o_r_t_r_a_n
real array(0:1024-1), coeff(1024+15)
PPPPaaaaggggeeee 1111
ssssssssccccaaaallll1111dddd,,,,ddddssssccccaaaallll1111dddd((((3333FFFF)))) ssssssssccccaaaallll1111dddd,,,,ddddssssccccaaaallll1111dddd((((3333FFFF))))
call scfft1dui( 1024, coeff)
call scfft1du( -1, 1024, array, 1, coeff)
call scfft1du( 1, 1024, array, 1, coeff)
call sscal1d( 1024, (1./real(1024)), array,1)
_C
#include <fft.h>
float array[1024], *coeff;
coeff = scfft1dui( 1024, NULL);
scfft1du( -1, 1024, array, 1, coeff);
csfft1du( 1, 1024, array, 1, coeff);
sscal1d( 1024, 1./(float)1024, array, 1);
NNNNOOOOTTTTEEEE____1111 :::: The Direct and Inverse transforms should use opposite signs -
Which one is used (+1 or -1) for Direct transform is just a matter of
convention-
NNNNOOOOTTTTEEEE____2222 :::: The Fourier Transforms are not normalized so the succession
Direct-Inverse transform scales the input data by a factor equal to the
size of the transform.
SSSSEEEEEEEE AAAALLLLSSSSOOOO
fft, scfft1dui, dzfft1dui, scfft1du, dzfft1du, csfft1du, zdfft1du,
sprod1du, dprod1du
PPPPaaaaggggeeee 2222